import 'package:fluttertoast/fluttertoast.dart';
import 'package:shouyin_app/common/base/base.dart';
import 'package:shouyin_app/common/utils/utils.dart';
import 'package:shouyin_app/pages/table/table.dart';

class TableView extends StatelessWidget {
  const TableView({super.key});

  @override
  Widget build(BuildContext context) {
    return GetBuilder<TableController>(
        init: TableController(),
        builder: (controller) => Container(
      color: Colors.lightGreen,
          child: GridView.builder(
              gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
                crossAxisCount: 8, //每行显示的元素个数
                mainAxisSpacing: 10.0, //垂直item之间间距
                crossAxisSpacing: 10.0, //水平item之间间距
                childAspectRatio: 0.85, //宽高比
              ),
              itemCount: 50,
              itemBuilder: (context,index) => Container(
                decoration:const BoxDecoration(
                  color: Colors.blue,
                ),
                child: GestureDetector(
                  onDoubleTap: () {
                    ToastUtils.showToast('$index');
                  },
                  child: Center(
                    child: Text('$index'),
                  ),
                ),
              ),
          ),
    )) ;
  }
}
